<template>
  <div>我是bar组件，接受父组件值：{{ name }}</div>
</template>

<script>
import { inject } from "vue";
export default {
  setup() {
    const name = inject("name");
    const setName = inject("setName");
    return {
      name,
      setName,
    };
  },
};
</script>

<style>
</style>